package com.bishe.tax.utils.taskListener;

import java.util.List;

import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;

import com.bishe.tax.entity.SysUser;
import com.bishe.tax.service.SysUserService;
import com.bishe.tax.utils.SpringContextHolder;

public class SingleExamine implements TaskListener {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * 指定个人任务和组任务的办理人
	 */
	@Override
	public void notify(DelegateTask delegateTask) {

		SysUserService userService = SpringContextHolder.popBean("sysUserService",
				SysUserService.class);
		List<SysUser> ls = userService.selectUserByAdmin();
		for (SysUser user : ls) {
			delegateTask.addCandidateUser(user.getUserId().toString());// 分配组任务的办理人
		}
	}
}
